  <?php
header("Content-type:text/html;charset=utf-8");
$Conn = @mysql_connect('localhost','root','')
	Or die('数据库无法连接!');
        @mysql_select_db('neuvideo',$Conn)
	or die ('数据库不存在!');
	mysql_set_charset('utf-8');
	$sql= 'select * from users';
	$result = mysql_query($sql,$Conn);
	$users=fetch_array($result);
	echo '<table border="1">';
	echo'<caption>用户管理</caption>';
	echo '<tr><th>序号</th><th>用户名</th><th>性别</th><th>学历</th><th>爱好</th></tr>';
	foreach ($users as $index=>$one) {
		echo '<tr>';
		echo '<td>'.($index+1).'</td>';
		echo '<td>'.$one['uname'].'</td>';
		if($one['gender']==1){$sex='男';}
		else{$sex='女';}
		echo '<td>'.$sex.'</td>';
		echo '<td>'.$one['hobby'].'</td>';
		echo '<td>'.$one['degree'].'</td>';
		echo '</tr>';
	}
	function fetch_array($Results){
			$arrs = array();
		while($Results && ($row = mysql_fetch_assoc($Results))!==FALSE){
		$arrs[]=$row;
	}
		  return $arrs;
	}





